package com.dao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import hyl.core.MyFun;
import hyl.ext.base.ASession;

public class LoginDao {
	public static final Logger LogerLogin = LoggerFactory.getLogger("login");
	public static final Logger LogerReg = LoggerFactory.getLogger("register");
	public static final char 分隔号 = ',';

	public static void log_err(ASession tk, Logger log) {
		StringBuilder sb = new StringBuilder();
		sb.append("ip:" + tk.getIp()).append(分隔号);
		sb.append("账号:" + tk.getUserId()).append(分隔号);
		sb.append("时间戳:").append(MyFun.date2Str(MyFun.Long2Date(tk.getLastStamp()))).append(分隔号);
		sb.append("行为:").append(tk.msg.getMsg());
		log.info(sb.toString());
	}

	public static void log_nomal(ASession tk, Logger log) {
		StringBuilder sb = new StringBuilder();
		sb.append("ip:" + tk.getIp()).append(分隔号);
		sb.append("账号:" + tk.getUserId()).append(分隔号);
		sb.append("时间戳:").append(MyFun.date2Str(MyFun.Long2Date(tk.getLastStamp()))).append(分隔号);
		sb.append("行为:").append(tk.msg.getMsg());
		log.info(sb.toString());
	}
}
